<?php
    include('checkAdminAccess.php');
    $iniVars = parse_ini_file('../../config.ini',TRUE);
    include('../classes/adodb5/adodb.inc.php');
    include('../function/db.func.php');
    
    if(isset($_POST['ps_id']))
    {
        $ps_id = $_POST['ps_id'];
        $year = $_POST['yearx'];
        $prideData = $_POST['prideDatax'];
        $sql = "UPDATE pride_student SET ps_year=$year , ps_data='$prideData' WHERE ps_id=$ps_id";
        $result = $db->Execute($sql);
        if($result)
        {
            echo 'success';
        }
    }
    else
    {
        $stuId = $_POST['stuId'];
        $year = $_POST['year'];
        $prideData = $_POST['prideData'];
        $sql = "INSERT INTO pride_student VALUES('','$stuId','$year','$prideData')";
        $result = $db->Execute($sql);
        if($result)
        {
            echo 'success';
        }
    }
?>